package com.xdjd.mobile.business.dao.daoservice.member;

import com.xdjd.mobile.business.dao.mapper.member.MemberExchangeRecordPoDao;
import com.xdjd.mobile.business.entity.model.member.MemberExchangeRecordPo;
import net.oschina.durcframework.easymybatis.PageInfo;
import net.oschina.durcframework.easymybatis.query.Query;
import net.oschina.durcframework.easymybatis.query.Sort;
import net.oschina.durcframework.easymybatis.util.QueryUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class MemberExchangeRecordPoService {

    @Autowired
    private MemberExchangeRecordPoDao memberExchangeRecordPoDao;

    public PageInfo<MemberExchangeRecordPo> getExchangeRecordList(Long memberId, Integer pageIndex, Integer pageSize) {
        Query query = new Query().eq("member_id", memberId)
                .addSort("create_time", Sort.DESC).page(pageIndex, pageSize);
        return QueryUtils.query(memberExchangeRecordPoDao, query);
    }
}
